package com.example.project.projectspringcloud.service.impl.user;

import com.example.project.projectspringcloud.common.OperationException;
import com.example.project.projectspringcloud.dao.user.CollectMapper;
import com.example.project.projectspringcloud.entity.Page;
import com.example.project.projectspringcloud.entity.user.Collect;
import com.example.project.projectspringcloud.service.BaseService;
import com.example.project.projectspringcloud.service.user.UserCollectService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 收藏Service
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class UserCollectServiceImpl extends BaseService<Collect, CollectMapper> implements UserCollectService {

    @Override
    public Collect get(Collect collect) {
        return super.mapper.selectOne(collect);
    }

    @Override
    public List<Collect> list(Page page, Collect collect) {
        return super.list(page, collect);
    }

    @Override
    public boolean save(Collect collect) {
        return super.save(collect);
    }

    @Override
    public boolean delete(Integer[] ids) {
        return super.mapper.deleteByArrayPrimaryKey(ids) > 0;
    }
}
